package org.ucas.faker.web.controller.graph;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.ucas.faker.web.annotation.Registry;
import org.ucas.faker.web.service.graph.Graph8Service;

@RestController
public class Graph8Controller {

	@Autowired
	Graph8Service g8Serv;
	

	@Registry(code = "0xE80011",subscriber = "yinrun")
	@RequestMapping(value = "/ApplyAndAuthorize",method = RequestMethod.GET)
	  public HashMap<String,List<String>> ApplyAndAuthorize(){
		HashMap<String,List<String>> result = new HashMap<>();
		List< List <String> > mylist = g8Serv.graph_8011();

		result.put("xAxis", mylist.get(0));
		result.put("yValue1", mylist.get(1));
		result.put("yValue2", mylist.get(2));
		
	    return result;
	  }
	
	
	@Registry(code = "0xE80021",subscriber = "yinrun")
	@RequestMapping(value = "/KeyTechLawStatus",method = RequestMethod.GET)
	  public HashMap<String,List<String>> KeyTechLawStatus(){
		HashMap<String,List<String>> result = new HashMap<>();
		List< List <String> > mylist = g8Serv.graph_8002_1();

		result.put("xAxis", mylist.get(0));
		result.put("yValue1", mylist.get(1));
		result.put("yValue2", mylist.get(2));
		result.put("yValue3", mylist.get(3));
		
	    return result;
	  }
	
	@Registry(code = "0xE80022",subscriber = "yinrun")
	@RequestMapping(value = "/KeyTechLawStatusByStatus",method = RequestMethod.GET)
	  public HashMap<String,List<String>> KeyTechLawStatusByStatus(){
		HashMap<String,List<String>> result = new HashMap<>();
		List< List <String> > mylist = g8Serv.graph_8002_2();

		result.put("xAxis", mylist.get(0));
		result.put("yValue", mylist.get(1));
		
	    return result;
	  }
	
	@Registry(code = "0xE80031",subscriber = "yinrun")
	@RequestMapping(value = "/CountryApplyOrder",method = RequestMethod.GET)
	  public HashMap<String,List<String>> countryapplyorder(){
		HashMap<String,List<String>> result = new HashMap<>();
		List< List <String> > mylist = g8Serv.graph_8031();
		List<String> graph_0000_x_Axis = mylist.get(0);
		List<String> graph_0000_y_value = mylist.get(1);
		result.put("xAxis", graph_0000_x_Axis);
		result.put("yValue", graph_0000_y_value);
	    return result;
	  }
	
	@Registry(code = "0xE80041",subscriber = "yinrun")
	@RequestMapping(value = "/CountryApplyOrderYearTrend",method = RequestMethod.GET)
	  public HashMap<String,List<String>> countryapplyorderyeartrend(){
		HashMap<String,List<String>> result = new HashMap<>();
		List< List <String> > mylist = g8Serv.graph_8041();
		result.put("xAxis", mylist.get(0));
		result.put("blegend", mylist.get(1));
		for(int i=2;i<mylist.size();i++){
			result.put("valueY"+(i-2), mylist.get(i));
		}
	    return result;
	  }
	@Registry(code = "0xE80071",subscriber = "yinrun")
	@RequestMapping(value = "/SourceMarket",method = RequestMethod.GET)
	  public HashMap<String,List<String>> SourceMarket(){
		HashMap<String,List<String>> result = new HashMap<>();
		List< List <String> > mylist = g8Serv.graph_8071();
		result.put("xAxis", mylist.get(0));
		result.put("yAxis", mylist.get(1));
		for(int i=2;i<mylist.size();i++){
			result.put("valueY"+(i-2), mylist.get(i));
		}
	    return result;
	  }
	
	@Registry(code = "0xE80081",subscriber = "yinrun")
	@RequestMapping(value = "/ProvApplyOrder",method = RequestMethod.GET)
	  public HashMap<String,List<String>> provapplyorder(){
		HashMap<String,List<String>> result = new HashMap<>();
		List< List <String> > mylist = g8Serv.graph_8008();
		List<String> graph_0000_x_Axis = mylist.get(0);
		List<String> graph_0000_y_value = mylist.get(1);
		result.put("xAxis", graph_0000_x_Axis);
		result.put("yValue", graph_0000_y_value);
	    return result;
	  }
	
	
	@Registry(code = "0xE80101",subscriber = "yinrun")
	@RequestMapping(value = "/ProvApplyYearTrend",method = RequestMethod.GET)
	  public HashMap<String,List<String>> ProvApplyYearTrend(){
		HashMap<String,List<String>> result = new HashMap<>();
		List< List <String> > mylist = g8Serv.graph_8101();
		result.put("xAxis", mylist.get(0));
		result.put("blegend", mylist.get(1));
		for(int i=2;i<mylist.size();i++){
			result.put("valueY"+(i-2), mylist.get(i));
		}
	    return result;
	  }
	
	@Registry(code = "0xE80111",subscriber = "yinrun")
	@RequestMapping(value = "/Top20ApplyInst",method = RequestMethod.GET)
	  public HashMap<String,List<String>> Top20ApplyInst(){
		HashMap<String,List<String>> result = new HashMap<>();
		List< List <String> > mylist = g8Serv.graph_8111();
		List<String> graph_0000_x_Axis = mylist.get(0);
		List<String> graph_0000_y_value = mylist.get(1);
		result.put("xAxis", graph_0000_x_Axis);
		result.put("yValue", graph_0000_y_value);
	    return result;
	  }
	
	@Registry(code = "0xE80121",subscriber = "yinrun")
	@RequestMapping(value = "/InstApplyTrend",method = RequestMethod.GET)
	  public HashMap<String,List<String>> instapplytrend(){
		HashMap<String,List<String>> result = new HashMap<>();
		List< List <String> > mylist = g8Serv.graph_8121();
		result.put("xAxis", mylist.get(0));
		result.put("blegend", mylist.get(1));
		for(int i=2;i<mylist.size();i++){
			result.put("valueY"+(i-2), mylist.get(i));
		}
	    return result;
	  }
	
	@Registry(code = "0xE80122",subscriber = "yinrun")
	@RequestMapping(value = "/InstApplyTrendStack",method = RequestMethod.GET)
	  public HashMap<String,List<String>> instapplytrendstack(){
		HashMap<String,List<String>> result = new HashMap<>();
		List< List <String> > mylist = g8Serv.graph_8121();
		result.put("xAxis", mylist.get(0));
		result.put("blegend", mylist.get(1));
		for(int i=2;i<mylist.size();i++){
			result.put("valueY"+(i-2), mylist.get(i));
		}
	    return result;
	  }
	
	
	@Registry(code = "0xE80141",subscriber = "yinrun")
	@RequestMapping(value = "/T20InventorApply",method = RequestMethod.GET)
	  public HashMap<String,List<String>> T20InventorApply(){
		/*
		String xlabel = "广州食品控股株式会社,福建食品有限公司,上海以岭食品有限公司,南方食品有限公司,大连饮料有限公司,"
				+ "东洋制造株式会社,新日本制铁株式会社,日东制器株式会社,株式会社集团本社,上海有限公司";
		String ydata1 =  "32,16,2,5,7,8,9,4,3,2";
		String ydata2 =  "32,16,2,5,7,8,9,4,3,2";
		String ydata3 =  "32,16,2,5,7,8,9,4,3,2";
	    return "{\"xlabel\":\""+xlabel+"\",\"ydata1\":\""+ydata1+"\",\"ydata2\":\""+ydata2+"\",\"ydata3\":\""+ydata3+"\"}";
	    */
		HashMap<String,List<String>> result = new HashMap<>();
		List< List <String> > mylist = g8Serv.graph_8014();
		result.put("xAxis", mylist.get(0));
		result.put("yValue", mylist.get(1));
	    return result;
		
	  }
	
	
	@Registry(code = "0xE80021",subscriber = "yinrun")
	@RequestMapping(value = "/T10PatLawState",method = RequestMethod.GET)
	  public HashMap<String,List<String>> PatLawState(){
		/*
		String xlabel = "广州食品控股株式会社,福建食品有限公司,上海以岭食品有限公司,南方食品有限公司,大连饮料有限公司,"
				+ "东洋制造株式会社,新日本制铁株式会社,日东制器株式会社,株式会社集团本社,上海有限公司";
		String ydata1 =  "32,16,2,5,7,8,9,4,3,2";
		String ydata2 =  "32,16,2,5,7,8,9,4,3,2";
		String ydata3 =  "32,16,2,5,7,8,9,4,3,2";
	    return "{\"xlabel\":\""+xlabel+"\",\"ydata1\":\""+ydata1+"\",\"ydata2\":\""+ydata2+"\",\"ydata3\":\""+ydata3+"\"}";
	    */
		HashMap<String,List<String>> result = new HashMap<>();
		List< List <String> > mylist = g8Serv.graph_8015();
		result.put("xAxis", mylist.get(0));
		result.put("yValue1", mylist.get(1));
		result.put("yValue2", mylist.get(2));
		result.put("yValue3", mylist.get(3));
	    return result;
		
	  }
	
	
	
}
